home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / libraris / sregexp1 / part01 next >
Encoding:
Internet Message Format  |  1992-04-20  |  60.6 KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i135: sregexp.library 11.1 - a library for regular expressions, Part01/02
  4. Reply-To: "J. Spencer" <bhgs@utcs.utoronto.ca>
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga.v91i135@ab20.larc.nasa.gov>
  7. Date: 29 Jul 91 22:50:34 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga.misc
  11.  
  12. Submitted-by: "J. Spencer" <bhgs@utcs.utoronto.ca>
  13. Posting-number: Volume 91, Issue 135
  14. Archive-name: libraries/sregexp-11.1/part01
  15.  
  16. [ includes uuencoded libraries  ...tad ]
  17.  
  18. 'sregexp.library' is a run time library of routines for doing wildcard
  19. pattern matching and wildcard path matching.  It accepts a slight extension
  20. of the AmigaDOS wildcard syntax, including a not operator, and character
  21. sets. It has routines to test if a string matches a wildcard expression,
  22. and for scanning through all matches to a wildcarded AmigaDOS path.  There
  23. are two nifty features to the path matching routines: '.../' means
  24. recursively scan all subdirectories, and may come anywhere in the path; and
  25. wildcards are allowed in the volume node part of the path! (DH?: would
  26. match all your hard drive partitions.)
  27.  
  28.     new from version 9.1 -> 11.1
  29.  
  30.     Fixed a couple of bugs.
  31.  
  32.     A null string is now equivalent to a '%' in all cases, so
  33.     (cat|dog|) is the same as (cat|dog|%).
  34.  
  35.  
  36. #!/bin/sh
  37. # This is a shell archive.  Remove anything before this line, then unpack
  38. # it by saving it into a file and typing "sh file".  To overwrite existing
  39. # files, type "sh file -c".  You can also feed this as standard input via
  40. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  41. # will see the following message at the end:
  42. #        "End of archive 1 (of 2)."
  43. # Contents:  BUGS_TO COPYRIGHT.NOTICE OVERVIEW clibrary.asm
  44. #   compilation.notes dmakefile instillation.notes kludge.asm
  45. #   revision.history sreg_version.c sreg_version.i sregexp.fd
  46. #   sregexp.h sregexp.uu sregexp_protos.h sregexpbase.h sregexpbase.i
  47. #   sregexps.uu sregexpsr.uu utils utils/bumprev.c utils/remlib.c
  48. #   utils/try.c
  49. # Wrapped by tadguy@ab20 on Mon Jul 29 18:50:32 1991
  50. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  51. if test -f 'BUGS_TO' -a "${1}" != "-c" ; then 
  52.   echo shar: Will not clobber existing file \"'BUGS_TO'\"
  53. else
  54. echo shar: Extracting \"'BUGS_TO'\" \(94 characters\)
  55. sed "s/^X//" >'BUGS_TO' <<'END_OF_FILE'
  56. X
  57. XSend bug reports, comments, etc. to
  58. X
  59. X    Jon Spencer.
  60. X
  61. X    EMail:    bhgs@gpu.utcs.utoronto.ca
  62. X
  63. END_OF_FILE
  64. if test 94 -ne `wc -c <'BUGS_TO'`; then
  65.     echo shar: \"'BUGS_TO'\" unpacked with wrong size!
  66. fi
  67. # end of 'BUGS_TO'
  68. fi
  69. if test -f 'COPYRIGHT.NOTICE' -a "${1}" != "-c" ; then 
  70.   echo shar: Will not clobber existing file \"'COPYRIGHT.NOTICE'\"
  71. else
  72. echo shar: Extracting \"'COPYRIGHT.NOTICE'\" \(1083 characters\)
  73. sed "s/^X//" >'COPYRIGHT.NOTICE' <<'END_OF_FILE'
  74. X
  75. X    The library 'sregexp.library', and all sources and documentation
  76. X    relating to it included in this distribution are Copyright (c) 1991, by
  77. X    Jon Spencer.
  78. X
  79. X    Permission is given to redistribute any part or all of this
  80. X    distribution, either modified or unmodified, PROVIDED THAT:
  81. X    - the distribution is on a not-for-profit basis,
  82. X    - this copyright notice is included in the distribution,
  83. X    - and if a modified version is distributed, clear indication
  84. X      that it is modified is included.
  85. X
  86. X    All other rights are reserved by the author, Jon Spencer.
  87. X
  88. X
  89. X(disclaimer borrowed, somewhat modified, from the DICE distribution)
  90. X
  91. X    PROGRAM DISCLAIMER: THE LIBRARY IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  92. X    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  93. X    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  94. X    PURPOSE.  THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF ANY
  95. X    PROGRAM IS ASSUMED BY YOU.    Should the program prove defective, you
  96. X    assume the entire cost of all necessary servicing, repair, or
  97. X    correction.
  98. X
  99. END_OF_FILE
  100. if test 1083 -ne `wc -c <'COPYRIGHT.NOTICE'`; then
  101.     echo shar: \"'COPYRIGHT.NOTICE'\" unpacked with wrong size!
  102. fi
  103. # end of 'COPYRIGHT.NOTICE'
  104. fi
  105. if test -f 'OVERVIEW' -a "${1}" != "-c" ; then 
  106.   echo shar: Will not clobber existing file \"'OVERVIEW'\"
  107. else
  108. echo shar: Extracting \"'OVERVIEW'\" \(792 characters\)
  109. sed "s/^X//" >'OVERVIEW' <<'END_OF_FILE'
  110. X
  111. X'sregexp.library' is a run time library of routines for doing wildcard
  112. Xpattern matching and wildcard path matching.  It accepts a slight extension
  113. Xof the AmigaDOS wildcard syntax, including a not operator, and character
  114. Xsets. It has routines to test if a string matches a wildcard expression,
  115. Xand for scanning through all matches to a wildcarded AmigaDOS path.  There
  116. Xare two nifty features to the path matching routines: '.../' means
  117. Xrecursively scan all subdirectories, and may come anywhere in the path; and
  118. Xwildcards are allowed in the volume node part of the path! (DH?: would
  119. Xmatch all your hard drive partitions.)
  120. X
  121. X    new from version 9.1 -> 11.1
  122. X
  123. X    Fixed a couple of bugs.
  124. X
  125. X    A null string is now equivalent to a '%' in all cases, so
  126. X    (cat|dog|) is the same as (cat|dog|%).
  127. X
  128. END_OF_FILE
  129. if test 792 -ne `wc -c <'OVERVIEW'`; then
  130.     echo shar: \"'OVERVIEW'\" unpacked with wrong size!
  131. fi
  132. # end of 'OVERVIEW'
  133. fi
  134. if test -f 'clibrary.asm' -a "${1}" != "-c" ; then 
  135.   echo shar: Will not clobber existing file \"'clibrary.asm'\"
  136. else
  137. echo shar: Extracting \"'clibrary.asm'\" \(11630 characters\)
  138. sed "s/^X//" >'clibrary.asm' <<'END_OF_FILE'
  139. X
  140. X;**************************************************************************
  141. X;*                                      *
  142. X;* sregexp.library -- pattern matching run time library.          *
  143. X;*                                      *
  144. X;*                                      *
  145. X;* Startup module: this is heavily copied from the sample.library      *
  146. X;* in the RKM includes and autodocs.                      *
  147. X;* This also relies on some features of dice (in particular, registered   *
  148. X;* args and features of the linker.)  Be carefull if you make it with      *
  149. X;* something else.                              *
  150. X;*                                      *
  151. X;* Created: April 20, 1991                          *
  152. X;*                                      *
  153. X;**************************************************************************
  154. X
  155. X        CODE        sregexp.start
  156. X
  157. X        INCLUDE     "sregexpbase.i"
  158. X        INCLUDE     "exec/initializers.i"
  159. X        INCLUDE     "libraries/dos.i"
  160. X        INCLUDE     "exec/resident.i"
  161. X        INCLUDE     "exec/lists.i"
  162. X        INCLUDE     "exec/alerts.i"
  163. X        INCLUDE     "sreg_version.i"
  164. X
  165. X;--------------------------------------------------------------------
  166. X; some generally usefull macros hiding _LVO's
  167. X;--------------------------------------------------------------------
  168. XCALLSYS     macro
  169. X        jsr        _LVO\1(a6)
  170. X        endm
  171. X
  172. XXLIB        macro
  173. X        xref        _LVO\1
  174. X        endm
  175. X
  176. X;--------------------------------------------------------------------
  177. X; Declare the library calls I use. The _LVO's are brought in
  178. X; from amiga.lib
  179. X;--------------------------------------------------------------------
  180. X        XLIB        OpenLibrary
  181. X        XLIB        CloseLibrary
  182. X        XLIB        Alert
  183. X        XLIB        FreeMem
  184. X        XLIB        Remove
  185. X
  186. X;------ defined in Amiga.lib ------
  187. X        xref        _AbsExecBase
  188. X
  189. X;------ defined in the c source, the id string of my library. ------
  190. X        xref        _idString
  191. X
  192. X
  193. X
  194. X
  195. X;--------------------------------------------------------------------
  196. X; Make some stuff visible for debuging.
  197. X;--------------------------------------------------------------------
  198. X        xdef        Init
  199. X        xdef        EndCode
  200. X        xdef        RomTag
  201. X        xdef        funcTable
  202. X        xdef        dataTable
  203. X        xdef        InitRoutine
  204. X
  205. X        xdef        Open
  206. X        xdef        Close
  207. X        xdef        Expunge
  208. X        xdef        Reserved
  209. X
  210. X;--------------------------------------------------------------------
  211. X; The links to the c code are in the file kludge.asm, because the
  212. X; assembler I use doesn't like to make symbols starting with a @.
  213. X; But thats what DICE starts it's regargs routines with, so...
  214. X; I make the links with das, which comes with dice.
  215. X;
  216. X; my library routines
  217. X;--------------------------------------------------------------------
  218. X        xref        parsesregexp
  219. X        xref        freesregexp
  220. X        xref        matchsregexp
  221. X        xref        matchnsregexp
  222. X        xref        iswild
  223. X        xref        anchorpath
  224. X        xref        nextfile
  225. X        xref        buildpath
  226. X        xref        freespathinfo
  227. X
  228. X
  229. X
  230. X
  231. X
  232. X************************************************************************
  233. X* Ok, so much for the preamble, we can actually start to generate      *
  234. X* some code now.  The very first thing we should do is return an       *
  235. X* error if someone tries to run us like a program, seeing as we        *
  236. X* will be a perfectly legal AmigaDos load module.               *
  237. X************************************************************************
  238. X
  239. XStart:
  240. X        moveq.l     #-1,d0
  241. X        rts
  242. X
  243. X
  244. X;--------------------------------------------------------------------
  245. X; Ok, here's what exec is going to look for to tell it that we are
  246. X; a library.
  247. X;--------------------------------------------------------------------
  248. XRomTag:
  249. X        dc.w        RTC_MATCHWORD    ; magic
  250. X        dc.l        RomTag        ; pointer back to magic
  251. X        dc.l        EndCode        ; keep looking from here
  252. X        dc.b        RTF_AUTOINIT    ; yes, autoinit me.
  253. X        dc.b        VERSION        ; version number
  254. X        dc.b        NT_LIBRARY        ; I'm a library
  255. X        dc.b        0            ; no priority (typical)
  256. X        dc.l        sregexpname     ; I have a name
  257. X        dc.l        _idString        ; let's see some ID
  258. X        dc.l        Init        ; start me up
  259. X
  260. X
  261. X;--------------------------------------------------------------------
  262. X; Ok, heres the table of 4 vectors exec is going to look for
  263. X; to autoinit me.
  264. X;
  265. X; We are word alligned here.
  266. X;--------------------------------------------------------------------
  267. XInit:
  268. X        dc.l        SregExpBase_SIZE    ; size of library structure
  269. X        dc.l        funcTable        ; table of all my routines.
  270. X        dc.l        dataTable        ; LibStructure init data
  271. X        dc.l        InitRoutine     ; Where to start me.
  272. X
  273. X
  274. X;--------------------------------------------------------------------
  275. X; This is the list of functions in my library.
  276. X;--------------------------------------------------------------------
  277. XfuncTable:
  278. X        dc.l        Open
  279. X        dc.l        Close
  280. X        dc.l        Expunge
  281. X        dc.l        Reserved
  282. X
  283. X; my own little gems.
  284. X        dc.l        parsesregexp
  285. X        dc.l        freesregexp
  286. X        dc.l        matchsregexp
  287. X        dc.l        matchnsregexp
  288. X        dc.l        iswild
  289. X        dc.l        anchorpath
  290. X        dc.l        nextfile
  291. X        dc.l        buildpath
  292. X        dc.l        freespathinfo
  293. X        dc.l        -1            ; end of the list.
  294. X
  295. X;--------------------------------------------------------------------
  296. X; heres the stuff to initialise my Library structure.
  297. X;--------------------------------------------------------------------
  298. XdataTable:
  299. X        INITBYTE    LN_TYPE,NT_LIBRARY
  300. X        INITLONG    LN_NAME,sregexpname
  301. X        INITBYTE    LIB_FLAGS,LIBF_SUMUSED|LIBF_CHANGED
  302. X        INITWORD    LIB_VERSION,VERSION
  303. X        INITWORD    LIB_REVISION,REVISION
  304. X        INITLONG    LIB_IDSTRING,_idString
  305. X        dc.l        0
  306. X
  307. X
  308. X
  309. X*******************************************************************
  310. X* Ok, so now were really ready to get cooking.              *
  311. X* This routine is called when the library is first linked into      *
  312. X* the exec LibList.  The Library structure has already been      *
  313. X* initialised as per the dataTable instructions.          *
  314. X*                                  *
  315. X* When called, d0 has our library base and the segment list is      *
  316. X* pointed to by a0; a6 is a pointer to SysBase.           *
  317. X*******************************************************************
  318. X
  319. XInitRoutine:
  320. X        move.l        a4,-(sp)                ; put the lib pointer
  321. X        move.l        d0,a4            ; in a convinient place
  322. X
  323. X        move.l        a6,sb_SysBase(a4)       ; save SysBase
  324. X        move.l        a0,sb_SegList(a4)       ; save our seglist
  325. X
  326. X        lea.l        dosname(pc),a1          ; try and open up
  327. X        moveq.l     #0,d0            ; dos.library
  328. X        CALLSYS     OpenLibrary
  329. X
  330. X        move.l        d0,sb_DOSBase(a4)       ;save dos
  331. X        bne.s        1$
  332. X
  333. X
  334. X        ALERT        AG_OpenLib|AO_DOSLib    ; couldn't get dos!!!
  335. X
  336. X;------- That's all there is to do. --------
  337. X1$
  338. X        move.l        a4,d0
  339. X        move.l        (sp)+,a4
  340. X        rts
  341. X
  342. X
  343. X
  344. X***********************************************************************
  345. X* So good so far.  Now come the 4 standard library routines that      *
  346. X* every good library must have.  Each of these (in fact all of the    *
  347. X* library calls) comes with the pointer to our library base in a6.    *
  348. X***********************************************************************
  349. X
  350. X;----------------------------------------------------------------------
  351. X; To open the library, all we have to do is up the count of current
  352. X; users and reset the delayed expunge flag. This returns the library
  353. X; pointer on d0 if we successfully opened (which is always the case).
  354. X;----------------------------------------------------------------------
  355. XOpen:
  356. X        addq.w        #1,LIB_OPENCNT(a6)
  357. X        bclr        #LIBB_DELEXP,LIB_FLAGS(a6)
  358. X        move.l        a6,d0
  359. X        rts
  360. X
  361. X
  362. X
  363. X
  364. X;----------------------------------------------------------------------
  365. X; When we close the library, we decrease the count of current
  366. X; users. If this has reached zeros, then we check the delayed
  367. X; expunge flag and clean up if it is set.
  368. X; If this routine returns 0 then that's that.  If the return value
  369. X; is non-zero, it should be the segment pointer passed to the
  370. X; initialization routine, so we can be unloaded.
  371. X;----------------------------------------------------------------------
  372. XClose:
  373. X        ;--- set up the return value, which will be altered ---
  374. X        ;--- if we decide to do a delayed expunge.        ---
  375. X        moveq.l     #0,d0
  376. X        subq.w        #1,LIB_OPENCNT(a6)
  377. X        bne.s        1$
  378. X        btst        #LIBB_DELEXP,LIB_FLAGS(a6)
  379. X        beq.s        1$
  380. X
  381. X; --- take a shortcut into the Expunge routine that doesn't ---
  382. X; --- redo the tests we just did.                ---
  383. X        bsr.s        ReallyExpunge
  384. X
  385. X1$
  386. X; --- at this point, d0 is zero if we didn't expunge, otherwise ---
  387. X; --- it the address of our segment list.            ---
  388. X        rts
  389. X
  390. X
  391. X
  392. X;----------------------------------------------------------------------
  393. X; Ok, so now we want to try to unload.    First check if there
  394. X; are still any current openers, if so, just set the delayed
  395. X; expunge flag, and we'll go away when everyone closes us.
  396. X; Otherwise, clean up my resources and return the seg list to
  397. X; be unloaded
  398. X;----------------------------------------------------------------------
  399. XExpunge:
  400. X        tst.w        LIB_OPENCNT(a6)
  401. X        beq.s        ReallyExpunge
  402. X
  403. X        bset        #LIBB_DELEXP,LIB_FLAGS(a6)
  404. X        moveq.l     #0,d0            ;don't unload me please
  405. X        rts
  406. X
  407. XReallyExpunge:
  408. X        movem.l     d2/a5,-(sp)
  409. X        move.l        a6,a5
  410. X        move.l        sb_SysBase(a5),a6
  411. X
  412. X        move.l        sb_SegList(a5),d2       ;save seglist.
  413. X
  414. X        move.l        a5,a1            ;remove the library
  415. X        REMOVE                    ;from the system list
  416. X
  417. X        move.l        sb_DOSBase(a5),a1
  418. X        CALLSYS     CloseLibrary        ;close dos.
  419. X
  420. X        moveq.l     #0,d0
  421. X        move.l        a5,a1
  422. X        move.w        LIB_NEGSIZE(a5),d0
  423. X        sub.l        d0,a1
  424. X        add.w        LIB_POSSIZE(a5),d0
  425. X
  426. X        CALLSYS     FreeMem            ;free our library base.
  427. X
  428. X        move.l        d2,d0            ;unload us.
  429. X
  430. X        movem.l     (sp)+,d2/a5
  431. X        rts
  432. X
  433. X
  434. X;----------------------------------------------------------------------
  435. X; This is the reserved vector.    Just return 0.
  436. X;----------------------------------------------------------------------
  437. XReserved:
  438. X        moveq.l     #0,d0
  439. X        rts
  440. X
  441. X
  442. X
  443. X**********************************************************************
  444. X* That's all of the standard stuff.  As discussed above, the links   *
  445. X* to the c code are in the file kludge.asm                 *
  446. X**********************************************************************
  447. X
  448. X
  449. X
  450. X
  451. X
  452. X
  453. X
  454. X;----------------------------------------------------------------------
  455. X; Here are some stings used in the above.  I put them at the end so
  456. X; so I don't have to worry about alignment.
  457. X;----------------------------------------------------------------------
  458. Xdosname     DOSNAME
  459. X
  460. Xsregexpname    SREGEXPNAME
  461. X
  462. X;----------------------------------------------------------------------
  463. X; The end of the code, where exec can start looking for more RomTag
  464. X; structures if it wants to.
  465. X;----------------------------------------------------------------------
  466. X        EVEN
  467. XEndCode:
  468. X
  469. X
  470. X
  471. X
  472. X
  473. X**********************************************************************
  474. X*                                     *
  475. X* Now comes the clever part.  Dice (and the others, I think)         *
  476. X* references there global data from register a4.  What I do         *
  477. X* to have easy access to the Library structure data from the         *
  478. X* c code, is transfer a6 to a4 on each library call and then         *
  479. X* define the various things I want to access as offsets to         *
  480. X* this, in effect, tricking dice into thinking they're global        *
  481. X* variables.  The real benifit of this is I don't need my own        *
  482. X* custom links to the Exec and DOS library routines, because         *
  483. X* there exists perfectly valid global variables SysBase and         *
  484. X* DosBase.                                 *
  485. X*                                     *
  486. X**********************************************************************
  487. X
  488. X        DATA        data
  489. X
  490. X;---------------------------------------------------------------------
  491. X; This one is a little funny, it is the actual instance of the
  492. X; structure, and not a pointer to it.  It should be declared in
  493. X; the c code as 'extern struct SregExpBase SregExpBase;' and then
  494. X; referenced with the '.' and not the '->'.  This may not work
  495. X; I haven't tried it yet.
  496. X;----------------------------------------------------------------------
  497. X_SregExpBase    equ        0
  498. X        xdef        _SregExpBase
  499. X
  500. X;--- These are perfectly ordinary pointers ---
  501. X_SysBase    equ        sb_SysBase
  502. X        xdef        _SysBase
  503. X
  504. X_DOSBase    equ        sb_DOSBase
  505. X        xdef        _DOSBase
  506. X
  507. X        end
  508. X
  509. END_OF_FILE
  510. if test 11630 -ne `wc -c <'clibrary.asm'`; then
  511.     echo shar: \"'clibrary.asm'\" unpacked with wrong size!
  512. fi
  513. # end of 'clibrary.asm'
  514. fi
  515. if test -f 'compilation.notes' -a "${1}" != "-c" ; then 
  516.   echo shar: Will not clobber existing file \"'compilation.notes'\"
  517. else
  518. echo shar: Extracting \"'compilation.notes'\" \(1301 characters\)
  519. sed "s/^X//" >'compilation.notes' <<'END_OF_FILE'
  520. X
  521. X
  522. X    As it says in various places in the source, this whole thing is kind
  523. X    of DICE dependent.    If you know what you are doing you should be
  524. X    able to get it to compile under anything.
  525. X
  526. X    The c source was not written with an eye to portability, but I don't
  527. X    think it is too bad.
  528. X
  529. X    To make under another compiler you will almost definitely have to change
  530. X    the file kludge.asm, were the jump vectors into the code are.  Most
  531. X    likely you'll have to take the register parameters and stuff
  532. X    them onto the stack.
  533. X
  534. X    The easiest thing to do is just type 'dmake install' and trust
  535. X    my compilations.
  536. X
  537. X    PLEASE do not distribute modified versions, and if you do make sure
  538. X    the copyright notice is left intact AND you state clearly it is
  539. X    a modified version.
  540. X
  541. X
  542. X    Note that I made everything under 1.3 (I don't have 2.0).  There
  543. X    are a few things to consider, however.  I have made my own 1.3 version
  544. X    of the 'clib' directory, which is new to 2.0.  This also allowed
  545. X    me to make my own 1.3 registered args amigasr13.lib linker
  546. X    library.  If you want to remake this under 1.3 with dice, you will
  547. X    have to either come up with these yourself, or modify kludge.asm
  548. X    to stuff the parameters on to the stack. Under 2.0 everything should
  549. X    go, but no guarantees.
  550. X
  551. END_OF_FILE
  552. if test 1301 -ne `wc -c <'compilation.notes'`; then
  553.     echo shar: \"'compilation.notes'\" unpacked with wrong size!
  554. fi
  555. # end of 'compilation.notes'
  556. fi
  557. if test -f 'dmakefile' -a "${1}" != "-c" ; then 
  558.   echo shar: Will not clobber existing file \"'dmakefile'\"
  559. else
  560. echo shar: Extracting \"'dmakefile'\" \(1550 characters\)
  561. sed "s/^X//" >'dmakefile' <<'END_OF_FILE'
  562. X
  563. XOD = OBJS:sreg/
  564. X
  565. XCSRC = sregexp.c sreg_version.c spath.c
  566. XCOBJ = $(CSRC:"*.c":"$(OD)*.o")
  567. XOBJ = $(OD)clibrary.o $(OD)kludge.o $(COBJ)
  568. XJUNK = utils/try utils/remlib utils/bumprev
  569. XJUNKSRC = $(JUNK:"*":"*.c")
  570. X
  571. XLINKLIBS = amigasr13.lib cr.lib
  572. X
  573. XLIBRARY = sregexp.library
  574. X
  575. XCOPTS = -c -mRR -mS -proto
  576. X#COPTS = -c -mRR -mS -proto -D __DEBUG__
  577. X#COPTS = -c -mRR -mS -proto -D __DEBUG__ -D __MEMCHECK__
  578. X
  579. Xall : sregexpsr.lib sregexps.lib $(JUNK) $(LIBRARY)
  580. X
  581. X$(JUNK) : $(JUNKSRC)
  582. X    dcc -mRR -r -lsregexpsr -o %(left) %(right)
  583. X
  584. X$(LIBRARY) : $(OBJ)
  585. X    -Delete >NIL: %(left)
  586. X    dlink -o %(left) $(OBJ) $(LINKLIBS)
  587. X    utils/remlib $(LIBRARY)
  588. X    Protect %(left) -E
  589. X    Copy $(LIBRARY) Libs:
  590. X
  591. X$(OD)clibrary.o : clibrary.asm sreg_version.i
  592. X    -Delete >NIL: %(left)
  593. X    a68k -q -iAINC: -o%(left) clibrary.asm
  594. X
  595. X$(OD)kludge.o : kludge.asm
  596. X    -Delete >NIL: %(left)
  597. X    das -o%(left) %(right)
  598. X
  599. X$(COBJ) : $(CSRC)
  600. X    -Delete >NIL: %(left)
  601. X    dcc $(COPTS) -o %(left) %(right)
  602. X
  603. Xsregexpsr.lib : sregexp.fd sregexp_protos.h
  604. X    -Delete >NIL: %(left)
  605. X    fdtolib -mr sregexp.fd -o %(left) -h sregexp_protos.h
  606. X
  607. Xsregexps.lib : sregexp.fd
  608. X    -Delete >NIL: %(left)
  609. X    fdtolib sregexp.fd -o %(left)
  610. X
  611. Xsreg_version.i : $(CSRC) clibrary.asm kludge.asm utils/bumprev
  612. X    utils/bumprev
  613. X    touch sreg_version.i
  614. X
  615. Xclean :
  616. X    -Delete $(JUNK)
  617. X    -Delete $(OBJ)
  618. X    -Delete sregexpsr.lib sregexps.lib
  619. X
  620. Xinstall :
  621. X    Copy $(LIBRARY) Libs:
  622. X    Copy sregexpbase.h dinclude:pd/libraries
  623. X    Copy sregexp_protos.h dinclude:pd/clib
  624. X    Copy sregexps.lib dlib:
  625. X    Copy sregexpsr.lib dlib:
  626. END_OF_FILE
  627. if test 1550 -ne `wc -c <'dmakefile'`; then
  628.     echo shar: \"'dmakefile'\" unpacked with wrong size!
  629. fi
  630. # end of 'dmakefile'
  631. fi
  632. if test -f 'instillation.notes' -a "${1}" != "-c" ; then 
  633.   echo shar: Will not clobber existing file \"'instillation.notes'\"
  634. else
  635. echo shar: Extracting \"'instillation.notes'\" \(757 characters\)
  636. sed "s/^X//" >'instillation.notes' <<'END_OF_FILE'
  637. X
  638. X
  639. X    If you have dmake, then just change to this directory and
  640. X    type 'dmake install' and all of the files will be copied to
  641. X    the appropriate place (if not you can edit the dmake file)
  642. X
  643. X    If not, heres where they should go:
  644. X
  645. X    sregexp.library     should be copied to LIBS:
  646. X
  647. X    sregexps.lib        should go to DLIB:  If you use a different
  648. X    sregexpsr.lib        compiler, you will have to use whatever
  649. X                utility exists to turn the fd file into
  650. X                your kind of library.
  651. X
  652. X    sregexpbase.h        should go in the 'libraries' directory,
  653. X                where ever you keep your Amiga include
  654. X                files.
  655. X
  656. X    sregexp_protos.h    Under 2.0 this goes in 'clib'  I compiled
  657. X                everything under 1.3, but I have a fake
  658. X                1.3 clib directory of my own making.
  659. X                Basically put it where you want.
  660. X
  661. END_OF_FILE
  662. if test 757 -ne `wc -c <'instillation.notes'`; then
  663.     echo shar: \"'instillation.notes'\" unpacked with wrong size!
  664. fi
  665. # end of 'instillation.notes'
  666. fi
  667. if test -f 'kludge.asm' -a "${1}" != "-c" ; then 
  668.   echo shar: Will not clobber existing file \"'kludge.asm'\"
  669. else
  670. echo shar: Extracting \"'kludge.asm'\" \(1876 characters\)
  671. sed "s/^X//" >'kludge.asm' <<'END_OF_FILE'
  672. X
  673. X;-------------------------------------------------------------------
  674. X; Here are the links to the c code.  Anything that dice can't make
  675. X; registered arguement versions of would have to stick the stuff onto the
  676. X; stack.  Note that the fd file and dice must both have the same
  677. X; idea of what gets passed in what.  I will perhaps automate that
  678. X; one day.  For now just be carefull.
  679. X;-------------------------------------------------------------------
  680. X
  681. X        section     kludge,code
  682. X
  683. X        xdef        parsesregexp
  684. X        xref        @parsesregexp
  685. Xparsesregexp:
  686. X        move.l        a4,-(sp)
  687. X        move.l        a6,a4
  688. X        jsr        @parsesregexp(pc)
  689. X        move.l        (sp)+,a4
  690. X        rts
  691. X
  692. X        xdef        freesregexp
  693. X        xref        @freesregexp
  694. Xfreesregexp:
  695. X        move.l        a4,-(sp)
  696. X        move.l        a6,a4
  697. X        jsr        @freesregexp(pc)
  698. X        move.l        (sp)+,a4
  699. X        rts
  700. X
  701. X        xdef        matchsregexp
  702. X        xref        @matchsregexp
  703. Xmatchsregexp:
  704. X        move.l        a4,-(sp)
  705. X        move.l        a6,a4
  706. X        jsr        @matchsregexp(pc)
  707. X        move.l        (sp)+,a4
  708. X        rts
  709. X
  710. X        xdef        matchnsregexp
  711. X        xref        @matchnsregexp
  712. Xmatchnsregexp:
  713. X        move.l        a4,-(sp)
  714. X        move.l        a6,a4
  715. X        jsr        @matchnsregexp(pc)
  716. X        move.l        (sp)+,a4
  717. X        rts
  718. X
  719. X        xdef        iswild
  720. X        xref        @iswild
  721. Xiswild:
  722. X        move.l        a4,-(sp)
  723. X        move.l        a6,a4
  724. X        jsr        @iswild(pc)
  725. X        move.l        (sp)+,a4
  726. X        rts
  727. X
  728. X        xdef        anchorpath
  729. X        xref        @anchorpath
  730. Xanchorpath:
  731. X        move.l        a4,-(sp)
  732. X        move.l        a6,a4
  733. X        jsr        @anchorpath(pc)
  734. X        move.l        (sp)+,a4
  735. X        rts
  736. X
  737. X        xdef        nextfile
  738. X        xref        @nextfile
  739. Xnextfile:
  740. X        move.l        a4,-(sp)
  741. X        move.l        a6,a4
  742. X        jsr        @nextfile(pc)
  743. X        move.l        (sp)+,a4
  744. X        rts
  745. X
  746. X        xdef        buildpath
  747. X        xref        @buildpath
  748. Xbuildpath:
  749. X        move.l        a4,-(sp)
  750. X        move.l        a6,a4
  751. X        jsr        @buildpath(pc)
  752. X        move.l        (sp)+,a4
  753. X        rts
  754. X
  755. X        xdef        freespathinfo
  756. X        xref        @freespathinfo
  757. Xfreespathinfo:
  758. X        move.l        a4,-(sp)
  759. X        move.l        a6,a4
  760. X        jsr        @freespathinfo(pc)
  761. X        move.l        (sp)+,a4
  762. X        rts
  763. X
  764. X        end
  765. END_OF_FILE
  766. if test 1876 -ne `wc -c <'kludge.asm'`; then
  767.     echo shar: \"'kludge.asm'\" unpacked with wrong size!
  768. fi
  769. # end of 'kludge.asm'
  770. fi
  771. if test -f 'revision.history' -a "${1}" != "-c" ; then 
  772.   echo shar: Will not clobber existing file \"'revision.history'\"
  773. else
  774. echo shar: Extracting \"'revision.history'\" \(1088 characters\)
  775. sed "s/^X//" >'revision.history' <<'END_OF_FILE'
  776. X
  777. X    version 11.1
  778. X    Everything seems to be ok again.
  779. X
  780. X    version 10.xx
  781. X    Fixed a minor bug to make the null string equivalent to '%'
  782. X    in all cases.  Means (cat|dog|) is equivalent to (cat|dog|%)
  783. X    and not illegal, as it was before.  Also fixed a bug which
  784. X    occasionally caused a GURU.  Sometimes I would trash memory
  785. X    by terminating a string with 2 null's (Thanks to Stefan Becker
  786. X    for the report and solution of this one).  Fixed a bug that
  787. X    would cause it to loose memory if an illegal path was given
  788. X    to AnchorPath.    This same bug would also cause the occasional
  789. X    GURU depending on when exec decided to clean up memory.
  790. X
  791. X    version 9.x
  792. X    First version ready for general release, everything seems
  793. X    to work ok.
  794. X
  795. X    versions 4.0 - 8.xx
  796. X    Various steps on the long road to getting the path matching
  797. X    routines to actually work.
  798. X
  799. X    version 2.0 - 3.xx
  800. X    Porting of the pattern matching routines from a link time
  801. X    library to a run time library.
  802. X
  803. X    version 1.xx
  804. X    Figuring out how to make a @&*! Amiga run time library
  805. X    go.  WHY DOES IT GURU WHEN I EXPUNGE, AHHHHH!  Well
  806. X    it worked in the end.
  807. END_OF_FILE
  808. if test 1088 -ne `wc -c <'revision.history'`; then
  809.     echo shar: \"'revision.history'\" unpacked with wrong size!
  810. fi
  811. chmod +x 'revision.history'
  812. # end of 'revision.history'
  813. fi
  814. if test -f 'sreg_version.c' -a "${1}" != "-c" ; then 
  815.   echo shar: Will not clobber existing file \"'sreg_version.c'\"
  816. else
  817. echo shar: Extracting \"'sreg_version.c'\" \(69 characters\)
  818. sed "s/^X//" >'sreg_version.c' <<'END_OF_FILE'
  819. X
  820. X
  821. Xconst __far char idString[] = "sreglib 11.1 ("__DATE__")\x0d\x0a";
  822. END_OF_FILE
  823. if test 69 -ne `wc -c <'sreg_version.c'`; then
  824.     echo shar: \"'sreg_version.c'\" unpacked with wrong size!
  825. fi
  826. # end of 'sreg_version.c'
  827. fi
  828. if test -f 'sreg_version.i' -a "${1}" != "-c" ; then 
  829.   echo shar: Will not clobber existing file \"'sreg_version.i'\"
  830. else
  831. echo shar: Extracting \"'sreg_version.i'\" \(46 characters\)
  832. sed "s/^X//" >'sreg_version.i' <<'END_OF_FILE'
  833. X
  834. XVERSION     equ        11
  835. XREVISION    equ        1
  836. X
  837. X
  838. X
  839. X
  840. X
  841. X
  842. END_OF_FILE
  843. if test 46 -ne `wc -c <'sreg_version.i'`; then
  844.     echo shar: \"'sreg_version.i'\" unpacked with wrong size!
  845. fi
  846. # end of 'sreg_version.i'
  847. fi
  848. if test -f 'sregexp.fd' -a "${1}" != "-c" ; then 
  849.   echo shar: Will not clobber existing file \"'sregexp.fd'\"
  850. else
  851. echo shar: Extracting \"'sregexp.fd'\" \(279 characters\)
  852. sed "s/^X//" >'sregexp.fd' <<'END_OF_FILE'
  853. X##base _SregExpBase
  854. X##bias 30
  855. X##public
  856. XParseSregExp(p)(a0)
  857. XFreeSregExp(p)(a0)
  858. XMatchSregExp(p,p1,n)(a0,a1,d0)
  859. XMatchNSregExp(p,p1,n)(a0,a1,d0,d1)
  860. XIsWild(p)(a0)
  861. XAnchorPath(anchor,path)(a0,a1)
  862. XNextFile(p1,p2,n,n1)(a0,a1,d0,d1)
  863. XBuildPath(p1,p2,n)(a0,a1,d0)
  864. XFreeSpathInfo(p)(a0)
  865. X##end
  866. END_OF_FILE
  867. if test 279 -ne `wc -c <'sregexp.fd'`; then
  868.     echo shar: \"'sregexp.fd'\" unpacked with wrong size!
  869. fi
  870. # end of 'sregexp.fd'
  871. fi
  872. if test -f 'sregexp.h' -a "${1}" != "-c" ; then 
  873.   echo shar: Will not clobber existing file \"'sregexp.h'\"
  874. else
  875. echo shar: Extracting \"'sregexp.h'\" \(2201 characters\)
  876. sed "s/^X//" >'sregexp.h' <<'END_OF_FILE'
  877. X
  878. X/* This is used for COMPILING sregexp.library, it should not be included
  879. X  if you just USE the library.    See sregexpbase.h */
  880. X
  881. X#include <stddef.h>
  882. X#include <stdlib.h>
  883. X#include <string.h>
  884. X#include <ctype.h>
  885. X#include <clib/exec_protos.h>
  886. X#include <clib/dos_protos.h>
  887. X#include <libraries/dosextens.h>
  888. X#include "sregexpbase.h"
  889. X
  890. X#define TRUE    1
  891. X#define FALSE    0
  892. X
  893. X
  894. X#define MEM_ERROR    ERROR_NO_FREE_STORE    /* report no mem */
  895. X#define ILLEGAL_ERR    ERROR_INVALID_COMPONENT_NAME   /* bad sregexp */
  896. X
  897. X
  898. X/* some handy fingersaving macros. */
  899. X#define realen(a)       (((a)->sre_Flag&(SRF_REPEAT|SRF_NOT))?0:(a)->sre_MinLen)
  900. X#define isfixed(s)      (((s)->sre_Flag&(SRF_REPEAT|SRF_NOT|SRF_FIXLEN))==SRF_FIXLEN)
  901. X#define matchset(s,c)   ((s)->sre_Data.setchar[(c)/8] & 1 << (c)%8)
  902. X
  903. X#ifdef    __MEMCHECK__
  904. X
  905. X#define getmem(a)       checkmem(a,__BASE_FILE__,__LINE__)
  906. X#define freemem(p,s)    freecheck(p,s,__BASE_FILE__,__LINE__)
  907. X
  908. Xextern void *checkmem(int, char *, int);
  909. Xextern void freecheck(void *, int, char *, int);
  910. X
  911. X#else
  912. X
  913. X#define getmem(a)       AllocMem(a,0)
  914. X#define freemem(p,s)    FreeMem(p,s)
  915. X
  916. X#endif
  917. X
  918. X
  919. Xstatic struct SregExp *     parsesub(char **, char);
  920. Xstatic struct SregExp *     makesum(struct SregList *, int);
  921. Xstatic struct SregExp *     makeor(struct SregList *, int);
  922. Xstatic struct SregExp *     parseone(char **, char);
  923. Xstatic char            onechar(char **, char);
  924. Xstatic struct SregExp *     makenull(void);
  925. Xstatic char *            makeset(char **);
  926. Xstatic int            matchsum(struct SregExp *[], int, char *, int, int);
  927. Xstatic void            report(int);
  928. Xstatic struct SpathNode *   makespathnode(BPTR, char *, struct SregList *);
  929. Xstatic void            freespathnode(struct SpathNode *);
  930. Xstatic struct SregList *    parsepath(char *);
  931. X
  932. Xextern struct SregExp *     parsesregexp(char *);
  933. Xextern void            freesregexp(struct SregExp *);
  934. Xextern int            matchsregexp(char *, struct SregExp *, int);
  935. Xextern int            matchnsregexp(char *, struct SregExp *, int, int);
  936. Xextern int            iswild(char *);
  937. Xextern struct SpathInfo *   anchorpath(char *, char *);
  938. Xextern int            nextfile(struct SpathInfo *, char *, int, int);
  939. Xextern int            buildpath(struct SpathInfo *, char *, int);
  940. Xextern void            freespathinfo(struct SpathInfo *);
  941. X
  942. END_OF_FILE
  943. if test 2201 -ne `wc -c <'sregexp.h'`; then
  944.     echo shar: \"'sregexp.h'\" unpacked with wrong size!
  945. fi
  946. # end of 'sregexp.h'
  947. fi
  948. if test -f 'sregexp.uu' -a "${1}" != "-c" ; then 
  949.   echo shar: Will not clobber existing file \"'sregexp.uu'\"
  950. else
  951. echo shar: Extracting \"'sregexp.uu'\" \(12387 characters\)
  952. sed "s/^X//" >'sregexp.uu' <<'END_OF_FILE'
  953. Xbegin 600 sregexp.library
  954. XM```#\P`````````!``````````````AX```#Z0``"'AP_TYU2OP````$```!@
  955. XM6H`+"0````%*```0Y````!X````N````+@```&8```"2````R@```-@```#LM
  956. XM```!.@```5P```%H```!=````8````&,```!F````:0```&P```!O/_____@,
  957. XM```("0#````*```!2N````X&`-```!0`"]```!8``<```!@``!#D`````"\,W
  958. XM*$`I3@`B*4@`*D/Z`)YP`$ZN_=@I0``F9A9(YP$&+CP``X`'+'@`!$ZN_Y1,P
  959. XMWV"`(`PH7TYU4FX`(`BN``,`#B`.3G5P`%-N`"!F"@@N``,`#F<"81).=4INL
  960. XM`"!G"@CN``,`#G``3G5(YR`$*DXL;0`B)"T`*B)-(%$B:0`$(H@A20`$(FT`B
  961. XM)DZN_F)P`")-,"T`$)/`T&T`$DZN_RX@`DS?(`1.=7``3G5D;W,N;&EB<F%RP
  962. XM>0!S<F5G97AP+FQI8G)A<GD`3G$O#"A.3KH`<BA?3G4O#"A.3KH(W"A?3G4OD
  963. XM#"A.3KH)1"A?3G4O#"A.3KH)7BA?3G4O#"A.3KH/"BA?3G4O#"A.3KH/9BA?<
  964. XM3G4O#"A.3KH5>BA?3G4O#"A.3KH8X"A?3G4O#"A.3KH9LBA?3G4C?B@I6UT_'
  965. XM)7PG*@!.5?_\*TC__'``0>W__$ZZ``HB0"`)3EU.=4CG.#(D`$Y5__`K2/_\?
  966. XM<``K0/_TE<IV`'@`8``!)"!M__P@4`P0`'QF$$ZZ!FHF0"`+9AI@``&:8!1P.
  967. XM`2!M__Q.N@/B)D`@"V8$8``!A$JM__1G*B!M__@L2'(`<`A.NA\R+4``!"MN6
  968. XM``3_^$JM__AF+G!G3KH.8F```59@(G(`<`A.NA\.*T#_]"MM__3_^$JM__AF8
  969. XM"G!G3KH./F```3(L;?_X+(LL;?_X<``M0``$4H,L;?_\+%8,%@!\9@``@B`#4
  970. XM(&W_]$ZZ`70F0"`+9@1@``#^(`IG*B!M__`L2'(`<`A.NAZN+4``!"MN``3_,
  971. XM\$JM__!F*G!G3KH-WF```-)@'G(`<`A.NAZ*)$`K2O_P2JW_\&8*<&=.N@V^"
  972. XM8```LBQM__`LBRQM__!P`"U```12A"QM__Q2EG``*T#_]'8`+&W__"Q6M!9F6
  973. XM`/[42JW_]&<6(`,@;?_T3KH`XB9`(`MF$F```&Q@#$ZZ!2PF0"`+9@)@7'``E
  974. XM*T#_]"`*9TX@;?_P+$AR`'`(3KH>""U```0K;@`$__!*K?_P9@YP9TZZ#3@@@
  975. XM2TZZ!K9@)B!M__`@BR!M__!P`"%```12A"`$($I.N@%.)D`@"V8"8`0@"V!D4
  976. XM*VW_]/_X8"0@;?_X*V@`!/_T(FW_^"!13KH&<G`((&W_^$ZZ':XK;?_T__A*F
  977. XMK?_X9M8K2O_X8"0@;?_X*V@`!/_T(FW_^"!13KH&0G`((&W_^$ZZ'7XK;?_T/
  978. XM__A*K?_X9M9P`$Y=3-],'$YU2.<^,B1()`!X`'H$2H)F$B`\````TDZZ#(1PQ
  979. XM`&```+!@%G`!L()F$"Q2<`@@2DZZ'38@#F```)A"IR("Y8$@`5"`(A].NAT0:
  980. XM+$`@#F8,<&=.N@Q*<`!@``!V'+P`!QU\`````2U"``1V`&!4(%(2*``!2(%(;
  981. XMP7P#PH9G!'``8`H@4C(H``)(P2`!V(`@4A(H``%(@4C!?`?"AGP$O(%F!'`$"
  982. XM8`)P`,H`(`/E@"V2"`@F:@`$<`@@2DZZ'*PD2U*#M(-NJ#U$``*++@`!(`Y,!
  983. XMWTQ\3G5(YSXR)$@D`'H$0J<B`N6!(`%0@"(?3KH<:BQ`(`YF#'!G3KH+I'``4
  984. XM8```Y!R\``8=?`````$M0@`$=@!@``#`2H-F(B!2$"@``4B`2,!R`\"!9P9XP
  985. XM`&```'(@4C`H``)(P"@`8&0@4A(H``%(@4C!?`/"AF<$<`!@"B!2,B@``DC!T
  986. XM(`&PA&=">@`@4A(H``%(@4C!?`/"AF<$<`!@"B!2,B@``DC!(`&PA&P>(%(0[
  987. XM*``!2(!(P'(#P(%G!'@`8`H@4C`H``)(P"@`(%(2*``!2(%(P7P'PH9\!+R!_
  988. XM9@1P!&`"<`#*`"`#Y8`MD@@()FH`!'`(($I.NAN:)$M2@[2#;@#_/CU$``*+X
  989. XM+@`!(`Y,WTQ\3G5(YS`R)$@D`$Y5__P@4A`0D#P`*F<``3YJ))`\`-9G``%\4
  990. XMD#P`(V<\50!G``%85P!G``"04P!G``%D8``!<)`\`!5G``#@D#P`'&<``(A5Y
  991. XM`&<``4J0/``?9P`!0E4`9T)@``%*4I)P`"!*3KK_E"9`(`MF!G``8``!\@@K\
  992. XM`````6<6(#P```#23KH**B!+3KH#J'``8``!U`CK``$``6```<A2DG``($I.5
  993. XMNO]6)D`@"V8&<`!@``&T".L````!8``!J%*2<"D@2DZZ^Q(F0%*28``!EE*2O
  994. XM<@!P"$ZZ&I(F0"(+9@QP9TZZ"<QP`&```7P6O``!%WP`!``!-WP``0`"($I.]
  995. XMN@'F)T``!$JK``1F#G`$($M.NAIH<`!@``%.4I)@``%&4I)R`'`(3KH:0B9`D
  996. XM(@MF#'!G3KH)?'``8``!+!:\``(7?``$``$W?``!``)@``$64I)R`'`(3KH:)
  997. XM$B9`(@MF#'!G3KH)3'``8```_!:\``(7?``&``$W?``!``)@``#F4I).N@#J7
  998. XM)D`@"V8``-AP`&```-1@``#.(#P```#23KH)$'``8```P'(`<`A.NAF\)D`B/
  999. XM"V8,<&=.N@CV<`!@``"F%WP`!``!2@)F&G``($I.N@#*%T``!!:\``,W?``!$
  1000. XM``)@``"`*U+__'8`8`)2@W``0>W__$ZZ`*02`$H!9NXW0P`"<@&R@V82<``@I
  1001. XM2DZZ`(P70``$%KP``V!(%KP`!'(`<`'0@TZZ&4(G0``$*VL`!/_\2JW__&82/
  1002. XM<&=.N@AR<`0@2TZZ&31P`&`:(&W__%*M__PL2'``($I.N@!`'(!*%F;H(`M.2
  1003. XM74S?3`Q.=2\*<@!P"$ZZ&/0D0"(*9@IP9TZZ""YP`&`0%+P`!15\``0``35\K
  1004. XM`````B1?3G5(YR`@)$@D`"!2#!``)V8$4I)@)B!2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%*M_^000
  1067. XMD5,#2@-NZ"!M_^Q2K?_L$+P`.B!M_^P0O```2JH`!&88</X@;?_H3KH-$B0`9
  1068. XM2H)F`F!8(`).N@T<(&W_]")H``P@;?_H<`!.N@)\*T#_\$JM__!F("!M_^A.'
  1069. XMN@CX4H`@;?_H3KH-;B!M__1.N@=*<`!@``":(&W_\"%M_^@!%")M__`@;?_T*
  1070. XM3KH-6B`2Y8`D0"`*9@#^Y"!+3KKU\F!J(&W_^$H09R@@;?_T+$@@;?_X3KH`M
  1071. XM8BU```Q*K@`,9AIP$"!M__1.N@T,<`!@0&`*(&W_]'``(4``#"!M__0B:``,M
  1072. XM(&W__'``3KH!W"M`__!*K?_P9@@@;?_T3KH&O")M__`@;?_T3KH,W"`M__1.1
  1073. XM74S?3!Q.=4CG,#).5?_H*TC__'0!E<I"IR!M__Q.N@@F4H`B'TZZ#(XK0/_P&
  1074. XM2JW_\&8,<&=.NOO$<`!@``%R(FW__"!M__!.N@@\*VW_\/_X8```T'`$0_H&P
  1075. XMW"!M__A.N@?T(@!*@68(=H!8K?_X8`)V`"MM__C_]&`$4JW_^")M__A*$6<*V
  1076. XM(FW_^`P1`"]FZB)M__@4$2)M__@2O```(&W_]$ZZ[&0K0/_L2JW_[&8$8```[
  1077. XMIB!M_^R'*``!(&W_^%*M__@0@B(*9B!R`'`(3KH+Y"1`*TK_Z$JM_^AF,G!GZ
  1078. XM3KK[&&```')@)B!M_^@L2'(`<`A.N@N^+4``!"MN``3_Z$JM_^AF"'!G3KKZP
  1079. XM[F!(+&W_Z'``+4``!"QM_^@LK?_L+&W_^$H69P9*`F8`_R:T/``O9@PL;?_H`
  1080. XM+%8([@`&``$@;?_P3KH&_%*`(&W_\$ZZ"W(@"F!62JW_[&<((&W_[$ZZ]!H@W
  1081. XM;?_P3KH&V%*`(&W_\$ZZ"TXK2O_H8"@@;?_H2I!G"B)M_^@@44ZZ\_`@;?_H:
  1082. XM)F@`!'`((&W_Z$ZZ"R0K2__H2JW_Z&;2<`!.74S?3`Q.=4CG,#(D`"1()DER+
  1083. XM`"`\```!&DZZ"NHL0"(.9@QP9TZZ^B1P`&```'9*@F<((`).N@J>)@!P_B!*/
  1084. XM3KH*/"U``0Q*K@$,9A`@/````1H@3DZZ"KYP`&!&+4L!$$'N``@@+@$,3KH*[
  1085. XM.B(`2H%F&"`N`0Q.N@H<(#P```$:($Y.N@J0<`!@&#U\```!&'``+4`!%$J"M
  1086. XM9P8@`TZZ"C8@#DS?3`Q.=4CG/#(D2"9))``F`4Y5__QR`'``3KH*EB@`R+P`C
  1087. XM`/``9P9P_&```T0L:@`(2JX`!&80(#P```#H3KKY:'#_8``#*DJN`1!F,`@N^
  1088. XM``$!&6<$8``#"`CN``$!&4J#;0`"_"`"(DL@2DZZ`PHB`"`!8``"^F`$8``"M
  1089. XMY`@N```!&6<$8``"AB)N`1`B40P1``5F6#(N`1A(P0@!``%F``*^("X!#$ZZ0
  1090. XM":@B`$J!9@1@``*L".X``0$9".X``@$9(&X!$")H``1!^@04("X!#$ZZ_I`L6
  1091. XM0"`.9@9P_F```I`B3B!*3KH)FF``_RHB;@$0(E$,$0`$9PXB;@$0(E$,$0`#F
  1092. XM9@`"-")N`1`B41`I``%(@$C`"```!V8``AX(+@`!`1EG!&```C@([@`!`1D@6
  1093. XM+@$,3KH(_"@`(FX!$")1#!$`!&84</XB;@$0(E$@:0`$3KH(ABH`8!X@;@$0*
  1094. XM(%`;:``$__X;?```__]P_D'M__Y.N@AF*@`@!$ZZ"+9*A68$8``!W$'N``@@Y
  1095. XM!4ZZ"'0B`$J!9@P@!4ZZ"%AP_F```=`@!4ZZ"$P@;@$02J@`!&9"2JX`#&\(-
  1096. XM2H-M``&D8!P@;@$0(%`0*``!2(!(P`@```9F``&,2H-N``&&(`(B2R!*3KH!X
  1097. XME"(`(`%@``&$8`1@``%N2JX`#&\``68@;@$0(F@`!$'N`!`@+@$,3KK]5BQ`7
  1098. XM(`YF!G#^8``!5B).($I.N@A@8`#]\&```39@``$,<@!P`$ZZ"'PJ`,J\``#PH
  1099. XM`&<&</Q@``$J<``@;@$0(E!![@`03KKQ2BH`2H5G``"62JX`#&\:(FX!$")1^
  1100. XM&BD``4B%2,4(!0`'9P8([@```1DB;@$02JD`!&8X2JX`#&\&2H-M8&`8(FX!!
  1101. XM$")1&BD``4B%2,4(!0`&9DI*@VY&(`(B2R!*3KH`PBH`(`5@``"R8#)*K@`,?
  1102. XM;RP@;@$0(F@`!$'N`!`@+@$,3KK\BBQ`(`YF!G#^8```BB).($I.N@>48`#]H
  1103. XM)$JN``QO0")N`1`B41`I``%(@$C`"```!V<L"*X```$9(FX!$$'N`!`@+@$,B
  1104. XM3KK\0BQ`(`YF!'#^8$(B3B!*3KH'3F``_-Y![@`(("X!#$ZZ!M8B`$J!9@#^2
  1105. XMY$ZZ!O(B`+*\````Z&<$</Y@$"!*3KH'+B!.3KH!0F``_*A.74S?3#Q.=4CG9
  1106. XM(#(D4'(`=`&T@&\&</U@``#&2I)G&$JJ`11G$F`")%(L4DJ69P@L4DJN`11F<
  1107. XM\"9J`10D"V<``)1@#"0!4H$L2U*+$Y8H`$H39P2P@6[LL(%N``!X</U@``!^]
  1108. XM8```;@@J``(!&6<4)`%2@1.\`"\H`+"!;E1P_6!>8$Y'Z@`08`PD`5*!+$M2O
  1109. XMBQ.6*`!*$V<$L(%N[+"!;@1P_6`Z+%)*EF84+&H!$"Q6%"X``4B"2,((`@`&!
  1110. XM9Q(D`5*!$[P`+R@`L(%N!'#]8`XD4DJ29I`3O```&``@`4S?3`1.=4CG`#).2
  1111. XM5?_\*TC__&`&($I.N@!$(&W__$ZZ!B(D0"`*9NP@;?_\)F@`#&`4(%-.NNZF7
  1112. XM+&L`!'`(($M.N@7@)DX@"V;H<!`@;?_\3KH%T$Y=3-],`$YU+PHD2$JJ`11GW
  1113. XM$B!J`11.N@$V4H`@:@$43KH%K"`J`0Q.N@4D(#P```$:($I.N@68)%].=2\`=
  1114. XM+BXN+P````!#Z``$((EP`"%```0A2``(3G5.<4J!:PQ*@&L880``8B`!3G5$3
  1115. XM@4J`:Q9A``!41($@`4YU1(!A``!(1($@`4YU1(!A```\(`%.=4YQ80``,B`!X
  1116. XM3G5*@6L(2H!K$F```")$@4J`:Q)A```81(!.=42`80``#D2`3G5$@&````1.&
  1117. XM<4J!9QY(04I!9D(O`DA!)`"$P6D4(@)"04A!<``P`B0?3G4B`'#_3G4O`R0`?
  1118. XM0D)(0H3!-@)(0T)#-`"$P38"(`-"0DA"(@(F'R0?3G5(YS@`)`!"0DA"A,$V`
  1119. XM`G0`-`/&P4A!.`+(P4A#UH20@VL*(@`@`DS?`!Q.=5."T(%K^B(`(`),WP`<1
  1120. XM3G4B2&`"4HA*$&;Z(`B0B4YU2H!F&'``8"1@$DH!9P93@$J`9@1P`&`44HA2D
  1121. XMB1(0LA%GZ+(19`1P_V`"<`%.=4YQ+PHD2&`$4HE2B!"12A!F]B`*)%].=4YQP
  1122. XM8`P2`+(09@0@"&`04HA*$&;P2H!F!"`(8`)P`$YU3G%(YR`P2H!F&'``8%!@#
  1123. XM$DH!9P93@$J`9@1P`&!`4HA2B1(0=``4`47Z`D74PG0`%!%'^@([UL(4$K03Y
  1124. XM9])T`!0!1_H"*];"=``4$47Z`B'4PA03M!)D!'#_8`)P`4S?#`1.=4YQ``0$U
  1125. XM!`0$!`0$!$1$1$1$!`0$!`0$!`0$!`0$!`0$!`0$0!`0$!`0$!`0$!`0$!`08
  1126. XM$!D9&1D9&1D9&1D0$!`0$!`0DY.3DY.3DY.3DY.3DY.3DY.3DY.3DY.3DY,0X
  1127. XM$!`0$!`S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,Q`0$!`$````````````"
  1128. XM`````````````````````````````````````````````````````````````
  1129. XM`````````````````````````````````````````````````````````````
  1130. XM``````````````````````````````````````````````$"`P0%!@<("0H+"
  1131. XM#`T.#Q`1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL+2XO,#$R,S0U-C<XZ
  1132. XM.3H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3G5.<0```^P````7``````````8````*````$@``6
  1148. XM`!H````B````)@```"H````N````,@```#8````Z````<````!8```"*````L
  1149. XI/@```$(```!&````2@```$X```!2````5@```%H```!>`````````_**]
  1150. X``
  1151. Xend
  1152. Xsize 8816
  1153. END_OF_FILE
  1154. if test 12387 -ne `wc -c <'sregexp.uu'`; then
  1155.     echo shar: \"'sregexp.uu'\" unpacked with wrong size!
  1156. fi
  1157. # end of 'sregexp.uu'
  1158. fi
  1159. if test -f 'sregexp_protos.h' -a "${1}" != "-c" ; then 
  1160.   echo shar: Will not clobber existing file \"'sregexp_protos.h'\"
  1161. else
  1162. echo shar: Extracting \"'sregexp_protos.h'\" \(607 characters\)
  1163. sed "s/^X//" >'sregexp_protos.h' <<'END_OF_FILE'
  1164. X
  1165. X#ifndef LIBRARIES_SREGEXPBASE_H
  1166. X#include <libraries/sregexpbase.h>
  1167. X#endif
  1168. X
  1169. Xextern struct SregExpBase *SregExpBase;
  1170. X
  1171. Xextern struct SregExp *     ParseSregExp(char *);
  1172. Xextern void            FreeSregExp(struct SregExp *);
  1173. Xextern int            MatchSregExp(char *, struct SregExp *, int);
  1174. Xextern int            MatchNSregExp(char *, struct SregExp *, int, int);
  1175. Xextern int            IsWild(char *);
  1176. Xextern struct SpathInfo *   AnchorPath(char *, char *);
  1177. Xextern int            NextFile(struct SpathInfo *, char *, int, int);
  1178. Xextern int            BuildPath(struct Spathinf *, char *, int);
  1179. Xextern void            FreeSpathInfo(struct SpathInfo *);
  1180. X
  1181. END_OF_FILE
  1182. if test 607 -ne `wc -c <'sregexp_protos.h'`; then
  1183.     echo shar: \"'sregexp_protos.h'\" unpacked with wrong size!
  1184. fi
  1185. # end of 'sregexp_protos.h'
  1186. fi
  1187. if test -f 'sregexpbase.h' -a "${1}" != "-c" ; then 
  1188.   echo shar: Will not clobber existing file \"'sregexpbase.h'\"
  1189. else
  1190. echo shar: Extracting \"'sregexpbase.h'\" \(3432 characters\)
  1191. sed "s/^X//" >'sregexpbase.h' <<'END_OF_FILE'
  1192. X
  1193. X/*
  1194. X *
  1195. X * sregexpbase.h -- C include file for sregexp.library
  1196. X *
  1197. X * Copyright (C) 1991, Jon Spencer.
  1198. X *
  1199. X * Created: April 20,1991
  1200. X *
  1201. X */
  1202. X
  1203. X#ifndef LIBRARIES_SREGEXPBASE_H
  1204. X#define LIBRARIES_SREGEXPBASE_H
  1205. X
  1206. X#ifndef EXEC_TYPE_H
  1207. X#include <exec/types.h>
  1208. X#endif
  1209. X
  1210. X#ifndef EXEC_LISTS_H
  1211. X#include <exec/lists.h>
  1212. X#endif
  1213. X
  1214. X#ifndef EXEC_LIBRARIES_H
  1215. X#include <exec/libraries.h>
  1216. X#endif
  1217. X
  1218. X#ifndef LIBRARIES_DOS_H
  1219. X#include <libraries/dos.h>
  1220. X#endif
  1221. X
  1222. X
  1223. X/*
  1224. X *
  1225. X * Library base structure, all of these fields are private, and
  1226. X * should not be accessed.
  1227. X *
  1228. X */
  1229. X
  1230. Xstruct SregExpBase {
  1231. X    struct Library  LibNode;
  1232. X    struct Library  *SysBase;
  1233. X    struct Library  *DOSBase;
  1234. X    BPTR        Segment;
  1235. X};
  1236. X
  1237. X#define SREGEXPNAME       "sregexp.library"
  1238. X
  1239. X
  1240. X/*
  1241. X *
  1242. X * Here are the defines for the structures used and returned by
  1243. X * the various sreg functions.    They should probably not be
  1244. X * accessed for there contents, unless you have really good
  1245. X * reason...
  1246. X *
  1247. X */
  1248. X
  1249. Xstruct SregExp {
  1250. X    char            sre_Type,sre_Flag;
  1251. X    SHORT            sre_MinLen;
  1252. X    union {
  1253. X    char    onechar;
  1254. X    char    *setchar;
  1255. X    char    *string;
  1256. X    LONG    number;
  1257. X    }                sre_Data;
  1258. X    struct SregExp *        sre_List[];
  1259. X};
  1260. X
  1261. X
  1262. X/* This is an internal structure for a singly linked list of sregexp's */
  1263. Xstruct SregList {
  1264. X    struct SregExp        *srl_sreg;
  1265. X    struct SregList        *srl_next;
  1266. X};
  1267. X
  1268. X
  1269. X/* various types of wildcard pattern elements.
  1270. X    Goes in struct SregExp.type field */
  1271. X
  1272. X#define SRP_SETCHAR    1
  1273. X#define SRP_ANYCHAR    2
  1274. X#define SRP_ONECHAR    3
  1275. X#define SRP_STRING    4
  1276. X#define SRP_NULL    5
  1277. X#define SRP_OR        6
  1278. X#define SRP_SUM     7
  1279. X
  1280. X
  1281. X
  1282. X/* various flags to mark special properties of patterns.
  1283. X   Goes in struct SregExp.flag */
  1284. X
  1285. X#define SRF_NOT     (1<<0)
  1286. X#define SRF_REPEAT    (1<<1)
  1287. X#define SRF_FIXLEN    (1<<2)
  1288. X#define SRF_JUSTDIRS    (1<<6)    /* special flag used in path matching */
  1289. X#define SRF_RECURSE    (1<<7)    /* dito. */
  1290. X
  1291. X/* defines for the wildcard characters */
  1292. X
  1293. X#define CHR_REPEAT    '#'
  1294. X#define CHR_NOT     '~'
  1295. X#define CHR_OPENBRACE    '('
  1296. X#define CHR_CLOSEBRACE    ')'
  1297. X#define CHR_OPENSET    '['
  1298. X#define CHR_CLOSESET    ']'
  1299. X#define CHR_ANYCHAR    '?'
  1300. X#define CHR_NULL    '%'
  1301. X#define CHR_OR        '|'
  1302. X#define CHR_ESCAPE    '\''
  1303. X#define CHR_RANGE    '-'
  1304. X#define CHR_STAR    '*'
  1305. X
  1306. X
  1307. X
  1308. X
  1309. X/* These are the structures used for the path matching routines. */
  1310. X
  1311. Xstruct SpathInfo {
  1312. X    struct SpathNode *        spi_Head;
  1313. X    struct SpathNode *        spi_Tail;
  1314. X    struct SpathNode *        spi_TailPred;
  1315. X    struct SregList *        spi_SregList;
  1316. X};
  1317. X
  1318. X
  1319. X/* Note: because of the fileinfoblock, this whole structure MUST
  1320. X  be longword aligned. */
  1321. X
  1322. Xstruct SpathNode {
  1323. X    struct SpathNode *        spn_Succ;
  1324. X    struct SpathNode *        spn_Pred;
  1325. X    struct FileInfoBlock    spn_FIB;
  1326. X    BPTR            spn_Lock;
  1327. X    struct SregList *        spn_SregList;
  1328. X    char *            spn_NodeName;
  1329. X    short int            spn_Flags;
  1330. X};
  1331. X
  1332. X/* flags used in spn_Flags, which is  really library private  */
  1333. X#define SPF_DECEND    (1<<0)      /* Should recursively search, when we get the chance. */
  1334. X#define SPF_DONEONCE    (1<<1)      /* Already done it, don't do again */
  1335. X#define SPF_NEXTPARENT    (1<<2)      /* Next one is lock on parentdir */
  1336. X
  1337. X
  1338. X/* These are the possible error returns sent by NextFile and BuildPath */
  1339. X
  1340. X#define SPE_ALL_DONE    -1    /* no more matching files */
  1341. X#define SPE_ERROR    -2    /* some error occured, see IoErr() */
  1342. X#define SPE_BUFF_FULL    -3    /* you didn't give me enough room! */
  1343. X#define SPE_SIGBREAK    -4    /* A control signal came through.  */
  1344. X
  1345. X
  1346. X/* Some defines for what kind of events we match to. */
  1347. X
  1348. X#define SP_DIRS_ONLY    1
  1349. X#define SP_BOTH     0
  1350. X#define SP_FILES_ONLY    -1
  1351. X
  1352. X#endif
  1353. END_OF_FILE
  1354. if test 3432 -ne `wc -c <'sregexpbase.h'`; then
  1355.     echo shar: \"'sregexpbase.h'\" unpacked with wrong size!
  1356. fi
  1357. # end of 'sregexpbase.h'
  1358. fi
  1359. if test -f 'sregexpbase.i' -a "${1}" != "-c" ; then 
  1360.   echo shar: Will not clobber existing file \"'sregexpbase.i'\"
  1361. else
  1362. echo shar: Extracting \"'sregexpbase.i'\" \(3339 characters\)
  1363. sed "s/^X//" >'sregexpbase.i' <<'END_OF_FILE'
  1364. X    IFND        LIBRARIES_SREGEXPBASE_I
  1365. XLIBRARIES_SREGEXPBASE_I set    1
  1366. X
  1367. X*********************************************************************
  1368. X*                                    *
  1369. X* sregbase.i -- asm include file for sreg.library            *
  1370. X*                                    *
  1371. X* Copyright (C) 1991, Jon Spencer.                                  *
  1372. X*                                    *
  1373. X* Created: April 20,1991                        *
  1374. X*                                    *
  1375. X*********************************************************************
  1376. X
  1377. X    IFND        EXEC_TYPES_I
  1378. X    INCLUDE     "exec/types.i"
  1379. X    ENDC
  1380. X
  1381. X    IFND        EXEC_LISTS_I
  1382. X    INCLUDE     "exec/lists.i"
  1383. X    ENDC
  1384. X
  1385. X    IFND        EXEC_LIBRARIES_I
  1386. X    INCLUDE     "exec/libraries.i"
  1387. X    ENDC
  1388. X
  1389. X    IFND        LIBRARIES_DOS_I
  1390. X    INCLUDE     "libraries/dos.i"
  1391. X    ENDC
  1392. X
  1393. X
  1394. X
  1395. X;
  1396. X;
  1397. X; Library base structure, all of these fields are private, and
  1398. X; should not be accessed.
  1399. X;
  1400. X;
  1401. X
  1402. X    STRUCTURE    SregExpBase,LIB_SIZE
  1403. X    APTR        sb_SysBase
  1404. X    APTR        sb_DOSBase
  1405. X    ULONG        sb_SegList
  1406. X    LABEL    SregExpBase_SIZE
  1407. X
  1408. X
  1409. X
  1410. XSREGEXPNAME    macro
  1411. X        dc.b        "sregexp.library",0
  1412. X        endm
  1413. X
  1414. X;
  1415. X;
  1416. X; Here are the equates for the structures used and returned by
  1417. X; the various sreg functions.  They should probably not be
  1418. X; accessed for there contents, unless you have really good
  1419. X; reason...
  1420. X;
  1421. X;
  1422. X    STRUCTURE    SregExp,0
  1423. X    BYTE            sre_Type
  1424. X    BYTE            sre_Flag
  1425. X    SHORT            sre_MinLen
  1426. X    ULONG            sre_Data
  1427. X    APTR            sre_List
  1428. X    LABEL    SregExp_SIZE
  1429. X
  1430. X
  1431. X; sre_Data is a union, here are its elements.
  1432. Xsre_onechar     EQU         sre_Data
  1433. Xsre_setchar     EQU         sre_Data
  1434. Xsre_string     EQU         sre_Data
  1435. Xsre_number     EQU         sre_Data
  1436. X
  1437. X
  1438. X; This is an internal structure for a singly linked list of sregexp's
  1439. X
  1440. X    STRUCTURE    SregList,0
  1441. X    APTR            srl_sreg
  1442. X    APTR            srl_next
  1443. X    LABEL    SregList_SIZE
  1444. X
  1445. X
  1446. X; various types of wildcard pattern elements.  Goes in spat_t.type
  1447. X
  1448. XSRP_SETCHAR  EQU         1
  1449. XSRP_ANYCHAR  EQU         2
  1450. XSRP_ONECHAR  EQU         3
  1451. XSRP_STRING   EQU         4
  1452. XSRP_NULL     EQU         5
  1453. XSRP_OR         EQU         6
  1454. XSRP_SUM      EQU         7
  1455. X
  1456. X; various flags to mark special properties of patterns.
  1457. X; Goes in SregExp.sre_Flag
  1458. X
  1459. X    BITDEF    SR,NOT,0
  1460. X    BITDEF    SR,REPEAT,1
  1461. X    BITDEF    SR,FIXLEN,2
  1462. X    BITDEF    SR,JUSTDIRS,6
  1463. X    BITDEF    SR,RECURSE,7
  1464. X
  1465. X; equates for the wildcard characters
  1466. X
  1467. XCHR_REPEAT    EQU        '#'
  1468. XCHR_NOT     EQU        '~'
  1469. XCHR_OPENBRACE    EQU        '('
  1470. XCHR_CLOSEBRACE    EQU        ')'
  1471. XCHR_OPENSET    EQU        '['
  1472. XCHR_CLOSESET    EQU        ']'
  1473. XCHR_ANYCHAR    EQU        '?'
  1474. XCHR_NULL    EQU        '%'
  1475. XCHR_OR        EQU        '|'
  1476. XCHR_ESCAPE    EQU        "'"
  1477. XCHR_RANGE    EQU        '-'
  1478. XCHR_STAR    EQU        '*'
  1479. X
  1480. X
  1481. X;
  1482. X; These are the structures used for the path matching routines.
  1483. X;
  1484. X
  1485. X    STRUCTURE    SpathInfo,0
  1486. X    APTR        spi_Head
  1487. X    APTR        spi_Tail
  1488. X    APTR        spi_TailPred
  1489. X    APTR        spi_SregList;
  1490. X    LABEL    SpathInfo_SIZE
  1491. X
  1492. X
  1493. X; Note: because of the fileinfoblock, this whole structure MUST
  1494. X; be longword aligned.
  1495. X
  1496. X    STRUCTURE    SpathNode,0
  1497. X    APTR        spn_Succ
  1498. X    APTR        spn_Pred
  1499. X    STRUCT        spn_FIB,fib_SIZEOF
  1500. X    BPTR        spn_Lock
  1501. X    APTR        spn_SregList
  1502. X    APTR        spn_NodeName
  1503. X    SHORT        spn_Flags
  1504. X    LABEL    SpathNode_SIZE
  1505. X
  1506. X; flags used in spn_Flags, which is  really library private.
  1507. X
  1508. X    BITDEF  SP,DECEND,0
  1509. X    BITDEF  SP,DONEONCE,1
  1510. X    BITDEF  SP,NEXTPARENT,2
  1511. X
  1512. X; These are the possible error returns sent by NextFile and BuildPath
  1513. X
  1514. XSPE_ALL_DONE    EQU    -1
  1515. XSPE_ERROR    EQU    -2
  1516. XSPE_BUFF_FULL    EQU    -3
  1517. XSPE_SIGBREAK    EQU    -4
  1518. X
  1519. X
  1520. X; Some defines for what kind of events we match to.
  1521. X
  1522. XSP_DIRS_ONLY    EQU    1
  1523. XSP_BOTH     EQU    0
  1524. XSP_FILES_ONLY    EQU    -1
  1525. X
  1526. X    ENDC
  1527. END_OF_FILE
  1528. if test 3339 -ne `wc -c <'sregexpbase.i'`; then
  1529.     echo shar: \"'sregexpbase.i'\" unpacked with wrong size!
  1530. fi
  1531. # end of 'sregexpbase.i'
  1532. fi
  1533. if test -f 'sregexps.uu' -a "${1}" != "-c" ; then 
  1534.   echo shar: Will not clobber existing file \"'sregexps.uu'\"
  1535. else
  1536. echo shar: Extracting \"'sregexps.uu'\" \(1705 characters\)
  1537. sed "s/^X//" >'sregexps.uu' <<'END_OF_FILE'
  1538. Xbegin 600 sregexps.lib
  1539. XM```#YP````````/H`````````^D````%+PX@;P`(+&P``$ZN_^(L7TYU3G$`<
  1540. XM``/OA@```U]3<F5G17AP0F%S90````$````(`0``!%]087)S95-R96=%>'``Y
  1541. XM`````````````````_(```/G`````````^@````````#Z0````4O#B!O``@L[
  1542. XM;```3J[_W"Q?3G5.<0```^^&```#7U-R96=%>'!"87-E`````0````@!```#P
  1543. XM7T9R9653<F5G17AP``````````````/R```#YP````````/H`````````^D`5
  1544. XM```&+PY,[P,```@@+P`0+&P``$ZN_]8L7TYU```#[X8```-?4W)E9T5X<$)A:
  1545. XM<V4````!````#@$```1?36%T8VA3<F5G17AP``````````````````/R```#N
  1546. XMYP````````/H`````````^D````'+PY,[P,```A,[P`#`!`L;```3J[_T"Q?$
  1547. XM3G5.<0```^^&```#7U-R96=%>'!"87-E`````0```!`!```$7TUA=&-H3E-R*
  1548. XM96=%>'`````````````````#\@```^<````````#Z`````````/I````!2\.Q
  1549. XM(&\`""QL``!.KO_*+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!````5
  1550. XM"`$```)?27-7:6QD```````````````#\@```^<````````#Z`````````/IL
  1551. XM````!2\.3.\#```(+&P``$ZN_\0L7TYU```#[X8```-?4W)E9T5X<$)A<V4``
  1552. XM```!````"@$```-?06YC:&]R4&%T:````````````````_(```/G````````U
  1553. XM`^@````````#Z0````<O#DSO`P``"$SO``,`$"QL``!.KO^^+%].=4YQ```#0
  1554. XM[X8```-?4W)E9T5X<$)A<V4````!````$`$```-?3F5X=$9I;&4`````````C
  1555. XM`````````_(```/G`````````^@````````#Z0````8O#DSO`P``""`O`!`L*
  1556. XM;```3J[_N"Q?3G4```/OA@```U]3<F5G17AP0F%S90````$````.`0```U]"T
  1557. XM=6EL9%!A=&@````````````````#\@```^<````````#Z`````````/I````Q
  1558. XM!2\.(&\`""QL``!.KO^R+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!_
  1559. XM````"`$```1?1G)E95-P871H26YF;P````````````````/R```#YP``````9
  1560. XM``/H`````````^D````````#[P(```5?3%9/1G)E95-P871H26YF;P```/__L
  1561. XM_[("```$7TQ63T)U:6QD4&%T:````/___[@"```#7TQ63TYE>'1&:6QE____J
  1562. XMO@(```1?3%9/06YC:&]R4&%T:```____Q`(```-?3%9/27-7:6QD``#____*E
  1563. XM`@``!5],5D]-871C:$Y3<F5G17AP````____T`(```1?3%9/36%T8VA3<F5GQ
  1564. XM17AP____U@(```1?3%9/1G)E95-R96=%>'``____W`(```1?3%9/4&%R<V533
  1565. X2<F5G17AP____X@````````/R_
  1566. X``
  1567. Xend
  1568. Xsize 1188
  1569. END_OF_FILE
  1570. if test 1705 -ne `wc -c <'sregexps.uu'`; then
  1571.     echo shar: \"'sregexps.uu'\" unpacked with wrong size!
  1572. fi
  1573. # end of 'sregexps.uu'
  1574. fi
  1575. if test -f 'sregexpsr.uu' -a "${1}" != "-c" ; then 
  1576.   echo shar: Will not clobber existing file \"'sregexpsr.uu'\"
  1577. else
  1578. echo shar: Extracting \"'sregexpsr.uu'\" \(1623 characters\)
  1579. sed "s/^X//" >'sregexpsr.uu' <<'END_OF_FILE'
  1580. Xbegin 600 sregexpsr.lib
  1581. XM```#YP````````/H`````````^D````$+PXL;```3J[_XBQ?3G5.<0```^^&\
  1582. XM```#7U-R96=%>'!"87-E`````0````0!```$0%!A<G-E4W)E9T5X<```````>
  1583. XM```````````#\@```^<````````#Z`````````/I````!"\.+&P``$ZN_]PL2
  1584. XM7TYU3G$```/OA@```U]3<F5G17AP0F%S90````$````$`0```T!&<F5E4W)EI
  1585. XM9T5X<``````````````#\@```^<````````#Z`````````/I````!"\.+&P`C
  1586. XM`$ZN_]8L7TYU3G$```/OA@```U]3<F5G17AP0F%S90````$````$`0``!$!-(
  1587. XM871C:%-R96=%>'```````````````````_(```/G`````````^@````````#K
  1588. XMZ0````0O#BQL``!.KO_0+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!N
  1589. XM````!`$```1`36%T8VA.4W)E9T5X<`````````````````/R```#YP``````A
  1590. XM``/H`````````^D````$+PXL;```3J[_RBQ?3G5.<0```^^&```#7U-R96=%R
  1591. XM>'!"87-E`````0````0!```"0$ES5VEL9````````````````_(```/G````6
  1592. XM`````^@````````#Z0````0O#BQL``!.KO_$+%].=4YQ```#[X8```-?4W)E`
  1593. XM9T5X<$)A<V4````!````!`$```-`06YC:&]R4&%T:````````````````_(`U
  1594. XM``/G`````````^@````````#Z0````0O#BQL``!.KO^^+%].=4YQ```#[X8`8
  1595. XM``-?4W)E9T5X<$)A<V4````!````!`$```-`3F5X=$9I;&4`````````````#
  1596. XM`````_(```/G`````````^@````````#Z0````0O#BQL``!.KO^X+%].=4YQ/
  1597. XM```#[X8```-?4W)E9T5X<$)A<V4````!````!`$```-`0G5I;&10871H````9
  1598. XM`````````````_(```/G`````````^@````````#Z0````0O#BQL``!.KO^R\
  1599. XM+%].=4YQ```#[X8```-?4W)E9T5X<$)A<V4````!````!`$```1`1G)E95-PO
  1600. XM871H26YF;P````````````````/R```#YP````````/H`````````^D`````_
  1601. XM```#[P(```5?3%9/1G)E95-P871H26YF;P```/___[("```$7TQ63T)U:6QD,
  1602. XM4&%T:````/___[@"```#7TQ63TYE>'1&:6QE____O@(```1?3%9/06YC:&]RB
  1603. XM4&%T:```____Q`(```-?3%9/27-7:6QD``#____*`@``!5],5D]-871C:$Y3;
  1604. XM<F5G17AP````____T`(```1?3%9/36%T8VA3<F5G17AP____U@(```1?3%9/B
  1605. XM1G)E95-R96=%>'``____W`(```1?3%9/4&%R<V53<F5G17AP____X@``````'
  1606. X#``/RU
  1607. X``
  1608. Xend
  1609. Xsize 1128
  1610. END_OF_FILE
  1611. if test 1623 -ne `wc -c <'sregexpsr.uu'`; then
  1612.     echo shar: \"'sregexpsr.uu'\" unpacked with wrong size!
  1613. fi
  1614. # end of 'sregexpsr.uu'
  1615. fi
  1616. if test ! -d 'utils' ; then
  1617.     echo shar: Creating directory \"'utils'\"
  1618.     mkdir 'utils'
  1619. fi
  1620. if test -f 'utils/bumprev.c' -a "${1}" != "-c" ; then 
  1621.   echo shar: Will not clobber existing file \"'utils/bumprev.c'\"
  1622. else
  1623. echo shar: Extracting \"'utils/bumprev.c'\" \(1133 characters\)
  1624. sed "s/^X//" >'utils/bumprev.c' <<'END_OF_FILE'
  1625. X
  1626. X#include <stdio.h>
  1627. X#include <string.h>
  1628. X#include <ctype.h>
  1629. X#include <stdlib.h>
  1630. X
  1631. Xint
  1632. Xmain(ac,av)
  1633. Xint ac;
  1634. Xchar **av;
  1635. X{
  1636. X    FILE *fp;
  1637. X    int i = 0,r,v,f=0;
  1638. X    char buff[100],*line[100],*p;
  1639. X
  1640. X    if (ac == 2 && strcmp(av[1],"-v") == 0)
  1641. X    f = 1;
  1642. X    if (!(fp = fopen("sreg_version.i","r+"))) {
  1643. X    puts("Unable to open input.");
  1644. X    return 30;
  1645. X    }
  1646. X
  1647. X    while (fgets(buff,100,fp) == buff)
  1648. X    line[i++] = strdup(buff);
  1649. X    line[i] = NULL;
  1650. X
  1651. X    fseek(fp,0,SEEK_SET);
  1652. X    for (i = 0; line[i]; i++) {
  1653. X    if (strncmp(line[i],"VERSION",7) == 0) {
  1654. X        p = line[i];
  1655. X        while (!isdigit(*p)) p++;
  1656. X        v = atoi(p);
  1657. X        if (f) {
  1658. X        v++;
  1659. X        sprintf(p,"%d\n",v);
  1660. X        }
  1661. X    } else
  1662. X    if (strncmp(line[i],"REVISION",8) == 0) {
  1663. X        p = line[i];
  1664. X        while (!isdigit(*p)) p++;
  1665. X        r = atoi(p)+1;
  1666. X        if (f)
  1667. X        r = 0;
  1668. X        sprintf(p,"%d\n",r);
  1669. X    }
  1670. X    fputs(line[i],fp);
  1671. X    }
  1672. X    fclose(fp);
  1673. X    if (!(fp = fopen("sreg_version.c","w"))) {
  1674. X    puts("Unable to open c file.");
  1675. X    return 10;
  1676. X    }
  1677. X    fprintf(fp,
  1678. X"\n\nconst __far char idString[] = \"sreglib %d.%d (\"__DATE__\")\\x0d\\x0a\";\n"
  1679. X,v,r);
  1680. X    fclose(fp);
  1681. X    printf("Up to version %d.%d\n",v,r);
  1682. X    return 0;
  1683. X}
  1684. END_OF_FILE
  1685. if test 1133 -ne `wc -c <'utils/bumprev.c'`; then
  1686.     echo shar: \"'utils/bumprev.c'\" unpacked with wrong size!
  1687. fi
  1688. # end of 'utils/bumprev.c'
  1689. fi
  1690. if test -f 'utils/remlib.c' -a "${1}" != "-c" ; then 
  1691.   echo shar: Will not clobber existing file \"'utils/remlib.c'\"
  1692. else
  1693. echo shar: Extracting \"'utils/remlib.c'\" \(523 characters\)
  1694. sed "s/^X//" >'utils/remlib.c' <<'END_OF_FILE'
  1695. X
  1696. X#include <exec/types.h>
  1697. X#include <exec/libraries.h>
  1698. X#include <clib/exec_protos.h>
  1699. X#include <exec/execbase.h>
  1700. X#include <stdio.h>
  1701. X#include <stdlib.h>
  1702. X
  1703. Xextern struct ExecBase *SysBase;
  1704. X
  1705. Xint
  1706. Xmain(ac,av)
  1707. Xint ac;
  1708. Xchar **av;
  1709. X{
  1710. X    struct Library *found;
  1711. X
  1712. X    if (ac != 2) {
  1713. X    puts("Use: remlib <library name>");
  1714. X    return 10;
  1715. X    }
  1716. X
  1717. X    Forbid();
  1718. X    if (found = (struct Library *)FindName(&SysBase->LibList,av[1]))
  1719. X    RemLibrary(found);
  1720. X    Permit();
  1721. X    if (!found)
  1722. X    return 5;
  1723. X    puts("OK, hopefully it is gone.");
  1724. X    return 0;
  1725. X}
  1726. END_OF_FILE
  1727. if test 523 -ne `wc -c <'utils/remlib.c'`; then
  1728.     echo shar: \"'utils/remlib.c'\" unpacked with wrong size!
  1729. fi
  1730. # end of 'utils/remlib.c'
  1731. fi
  1732. if test -f 'utils/try.c' -a "${1}" != "-c" ; then 
  1733.   echo shar: Will not clobber existing file \"'utils/try.c'\"
  1734. else
  1735. echo shar: Extracting \"'utils/try.c'\" \(1636 characters\)
  1736. sed "s/^X//" >'utils/try.c' <<'END_OF_FILE'
  1737. X
  1738. X#include "sregexpbase.h"
  1739. X#include "sregexp_protos.h"
  1740. X#include <libraries/dos.h>
  1741. X#include <clib/exec_protos.h>
  1742. X#include <clib/dos_protos.h>
  1743. X#include <string.h>
  1744. X#include <assert.h>
  1745. X#include <stdlib.h>
  1746. X
  1747. Xstruct SregExpBase *SregExpBase;
  1748. X
  1749. Xvoid
  1750. Xputs(c)
  1751. Xchar *c;
  1752. X{
  1753. Xchkabort();
  1754. X    Write(Output(),c,strlen(c));
  1755. X    Write(Output(),"\n",1);
  1756. X}
  1757. X
  1758. X#include <stdarg.h>
  1759. X
  1760. Xextern void vsprintf(char *, char *, va_list);
  1761. X
  1762. Xvoid printf(f, ...)
  1763. Xchar *f;
  1764. X{
  1765. X    char buff[100];
  1766. X    va_list va;
  1767. X
  1768. Xchkabort();
  1769. X    va_start(va,f);
  1770. X    vsprintf(buff,f,va);
  1771. X    va_end(va);
  1772. X    Write(Output(),buff,strlen(buff));
  1773. X}
  1774. X
  1775. Xint
  1776. Xbrk()
  1777. X{  /* Don't worry about lost memory for now... */
  1778. X
  1779. XWrite(Output(),"BREAK\n",6);
  1780. X    CloseLibrary(SregExpBase);
  1781. X    return 1;
  1782. X
  1783. X}
  1784. X
  1785. Xint
  1786. Xmain(ac,av)
  1787. Xint ac;
  1788. Xchar *av;
  1789. X{
  1790. X    struct SregExp *pat;
  1791. X    struct SpathInfo *spi;
  1792. X    char buff[300],fb[110];
  1793. X    BPTR    lock;
  1794. X
  1795. X    if (!(SregExpBase = OpenLibrary("sregexp.library",0))) {
  1796. X    puts("Unable to open library.");
  1797. X    return 5;
  1798. X    }
  1799. X    onbreak(brk);
  1800. X
  1801. X    pat = ParseSregExp("sys:docs/#?/&(#?)");
  1802. X    if (!pat) {
  1803. X    printf("%d\n",IoErr());
  1804. X    CloseLibrary(SregExpBase);
  1805. X    exit(1);
  1806. X    }
  1807. X
  1808. X    if (MatchSregExp("hello dog",pat,1))
  1809. X    puts("right");
  1810. X    else
  1811. X    puts("wrong");
  1812. X
  1813. X    if (MatchSregExp("hello Dog",pat,1))
  1814. X    puts("right");
  1815. X    else
  1816. X    puts("wrong");
  1817. X
  1818. X    if (MatchSregExp("hello Dog",pat,0))
  1819. X    puts("right");
  1820. X    else
  1821. X    puts("wrong");
  1822. X
  1823. X    if (MatchSregExp("hello cat",pat,1))
  1824. X    puts("right");
  1825. X    else
  1826. X    puts("wrong");
  1827. X
  1828. X    FreeSregExp(pat);
  1829. X
  1830. X    if (!(spi = AnchorPath("","sys:docs/#?/&(.doc|.txt|"))) {
  1831. X    printf("%d\n",IoErr());
  1832. X    CloseLibrary(SregExpBase);
  1833. X    exit(1);
  1834. X    }
  1835. X
  1836. X    FreeSpathInfo(spi);
  1837. X}
  1838. END_OF_FILE
  1839. if test 1636 -ne `wc -c <'utils/try.c'`; then
  1840.     echo shar: \"'utils/try.c'\" unpacked with wrong size!
  1841. fi
  1842. # end of 'utils/try.c'
  1843. fi
  1844. echo shar: End of archive 1 \(of 2\).
  1845. cp /dev/null ark1isdone
  1846. MISSING=""
  1847. for I in 1 2 ; do
  1848.     if test ! -f ark${I}isdone ; then
  1849.     MISSING="${MISSING} ${I}"
  1850.     fi
  1851. done
  1852. if test "${MISSING}" = "" ; then
  1853.     echo You have unpacked both archives.
  1854.     rm -f ark[1-9]isdone
  1855. else
  1856.     echo You still need to unpack the following archives:
  1857.     echo "        " ${MISSING}
  1858. fi
  1859. ##  End of shell archive.
  1860. exit 0
  1861. -- 
  1862. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1863. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1864. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  1865.